<template>
  <ul class="my_nav">
    <li>
      <router-link to="/">首页</router-link>
    </li>
    <li>
      <router-link to="/shop">购物</router-link>
    </li>
    <li>
      <router-link to="/file">
        <p class="add">+</p>
      </router-link>
    </li>
    <li>
      <router-link to="/message">消息</router-link>
    </li>
    <li @click="myData">
      <router-link to="/my">我的</router-link>
    </li>
  </ul>
</template>

<script>

import {my} from "@/api/my"
import { inject } from '@vue/runtime-core';
export default {
  name:"MyNav",
  setup(){
    const axios = inject("$http")
    // 我的数据
    function myData(){
      my(axios)
    }
    return {
      myData
    }
  }
};
</script>

<style lang="scss" scoped>
.my_nav {
  display: flex;
  justify-content: space-between;
  width: 100vw;
  // margin-top: 20px;
  padding: 3% 5% 3%;
  background: #fff;
  li {
    display: flex;
    align-items: center;
    
  }
  a {
    color: #999;
    font-size: 15px;
  }
  // 路由默认样式
  .active {
    // background: #000;
    font-weight: bold;
    color: #000;
  }
  .add {
    display: inline-block;
    width: 2.5rem;
    height: 1.8rem;
    line-height: 1.8rem;
    font-size: 24px;
    font-weight: bold;
    color: #fff;
    background: #FE273F;
    border-radius: 25%;
    text-align: center;
  }
}
</style>